UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1j14h5sfFHzuYCsDwhWdPIoNzb+8GYf0its7abcPv1I='
WHERE
key_id = '4420f5e475efc1590e63698ad595b3a285bb9123390b9817ce0218f24e6944eb'
AND (
token = '1j14h5sfFHzuYCsDwhWdPIoNzb+8GYf0its7abcPv1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)