UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WjK0LdNBHYFqeQVS1ttw08tDWGo4VB3ibXZe9hhiSuo='
WHERE
key_id = '83ef0501188d9f249d8812f9d0551991606837b7bbbc7b83f367c9be8c3cf238'
AND (
token = 'WjK0LdNBHYFqeQVS1ttw08tDWGo4VB3ibXZe9hhiSuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)