UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E5RLvaihaa7QC5PP1QBn8+BEkyS2j755ybG5pcxmqXY='
WHERE
key_id = 'f3ec4ea5a40ff6cb555e9b6b82b1573ddd40ebc6e50b29ecb5461014ee17f179'
AND (
token = 'E5RLvaihaa7QC5PP1QBn8+BEkyS2j755ybG5pcxmqXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)