UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z43rnscp7yCmZHOxZLzeVK9OxaQK5SzY1s1GQS1j0ZA='
WHERE
key_id = '0e84ca9936b4a43cb8769b4c26ff7769c6c5ae4277e571896e486cd0174d149c'
AND (
token = 'z43rnscp7yCmZHOxZLzeVK9OxaQK5SzY1s1GQS1j0ZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)