UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vsLL7QJl1/HRJXbJNaGPYjFZqHZuPoTtf2KeFqDY2Jk='
WHERE
key_id = 'c090128a9f60fa274e69dd6687d38d382806b2e87bdb6fc1c768fb84d4112acd'
AND (
token = 'vsLL7QJl1/HRJXbJNaGPYjFZqHZuPoTtf2KeFqDY2Jk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)