UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ssBXiuEq6+rDnVMZV6A1bTQO8vD2iVuL0qZo/RnO+MQ='
WHERE
key_id = '1e57221e6ee2887bca38357d39759b7afcc9605ed7f13705fa75849d55c682a1'
AND (
token = 'ssBXiuEq6+rDnVMZV6A1bTQO8vD2iVuL0qZo/RnO+MQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)