UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RdckK2tzgaM79umCndu1pZV9hKdMVeKGca1vPNBl3gY='
WHERE
key_id = 'ad86da7feefc596d32d9e62bee625b4fa283a24b9446f94aeff9cf3a5d9230d2'
AND (
token = 'RdckK2tzgaM79umCndu1pZV9hKdMVeKGca1vPNBl3gY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)