UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '06RuLPXSkuuWs1ygDpyJzDvlrNdZ9TzebnnUqyY+79w='
WHERE
key_id = 'eba1caf09f16ea3ddb32e1350c813708c83981aec95a948baa7bab77527276b9'
AND (
token = '06RuLPXSkuuWs1ygDpyJzDvlrNdZ9TzebnnUqyY+79w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)