UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9YKG0zpLyMmQ9OIZAANFpYB1MzEfOnE+WQMrvQwiBMk=' 
WHERE 
  key_id = '22559a1a99ea7fd6c54c8cdd86bfb902f46549c95667d8c5c2a461ddcdcf7640' 
  AND (
    token = '9YKG0zpLyMmQ9OIZAANFpYB1MzEfOnE+WQMrvQwiBMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029