UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HJj2BrQ1AjZPs6Ksp97TUvYXzHiPyqW3MnPLXL6WWsg='
WHERE
key_id = 'efa28dcca92977a95234bc7d8a7397b53cbac6f884f4d00ac9e7b271e9522a74'
AND (
token = 'HJj2BrQ1AjZPs6Ksp97TUvYXzHiPyqW3MnPLXL6WWsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)