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