UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oULGsGZMznTl8w5f4CeR8X/w4FdvG0UsjVqcDFPZHi8='
WHERE
key_id = 'dc55623dcbd57b6ff8784967566ad77e7d0cb988bc5bb640902b748a1992d559'
AND (
token = 'oULGsGZMznTl8w5f4CeR8X/w4FdvG0UsjVqcDFPZHi8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)