UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LMBntqyrIb6OIglrHB96IQQh7m5q+D1AXDp+m/wje+w='
WHERE
key_id = 'eda58e22fe73eb52701f5d620f4b1530ce11545eb33e005e73b56c554456b0ff'
AND (
token = 'LMBntqyrIb6OIglrHB96IQQh7m5q+D1AXDp+m/wje+w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)