UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kcT3bHJwt/Pl8ctXTRVfZtDZ1pR4zJn+0iLklSw1JPo='
WHERE
key_id = '638900e6e13650097084426f61bc9a51b47273fecb6f70555f20f525e30fa0dc'
AND (
token = 'kcT3bHJwt/Pl8ctXTRVfZtDZ1pR4zJn+0iLklSw1JPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)