UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PcK8vw8FmHCbPnSQQJyJA7/8WXP3YD8zW8eNVryRxFg='
WHERE
key_id = '0f3ea7bb32da2c8c7ecd1e5aa3f317375590c74de516a1e535100063e75d690b'
AND (
token = 'PcK8vw8FmHCbPnSQQJyJA7/8WXP3YD8zW8eNVryRxFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)