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