UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zkys3XlClFfRwGlomM9MmoY0F0ug2Czsv1GxGQeWjMs='
WHERE
key_id = '1cb3e835ac438cb1ffa8764bc644e3424025ea363a366b9c794100d01a9c1823'
AND (
token = 'zkys3XlClFfRwGlomM9MmoY0F0ug2Czsv1GxGQeWjMs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)