UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Zh3PdQaF8MCmEDmTR9Jsj3MbC4XkkQxRQ2goFX6VdA='
WHERE
key_id = '7a458e4ba57f753ee17cbb97b3d539c1e637644b2f142fe436024b8fe88c209b'
AND (
token = '4Zh3PdQaF8MCmEDmTR9Jsj3MbC4XkkQxRQ2goFX6VdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)