UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4y1WAaxgIQtD2+seYTj6xIak9RvoCSgpHB8dqTthuo4=' 
WHERE 
  key_id = '80c2c58a07ba8be05029426b42b4a88f508821a60de29dd11edd78d07b61e78e' 
  AND (
    token = '4y1WAaxgIQtD2+seYTj6xIak9RvoCSgpHB8dqTthuo4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044