UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UTv8kT+zGpaoT2aaiOzwXB+tFUXOuj9zkCR4cs2kE48='
WHERE
key_id = '4876fe0ec924cb497d4cd5a73df557eeac54ae0998329c45078974b7cae45083'
AND (
token = 'UTv8kT+zGpaoT2aaiOzwXB+tFUXOuj9zkCR4cs2kE48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)