UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MK2uEewo9jXgAQ1tIwE1wiyEvVfwYdc4LUL9JL4w65U=' 
WHERE 
  key_id = '9bb48bb01f08bc29380a0c39f5d44e010fdbbbbc823e7497e54ae381d2c6bb22' 
  AND (
    token = 'MK2uEewo9jXgAQ1tIwE1wiyEvVfwYdc4LUL9JL4w65U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036