UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y4uXQQ4fho7ycGQfjHXR/QE7vrwERTGHJGx6Y/5I4rE='
WHERE
key_id = 'fe8c6b9bb24979f65337ac877e20801edfe15ed972b8199b846f424fb3038ee0'
AND (
token = 'y4uXQQ4fho7ycGQfjHXR/QE7vrwERTGHJGx6Y/5I4rE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)