UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qotPXJ9c2Ikr4MiSha6d+/R5MXopne9+HznMNyElvtQ=' 
WHERE 
  key_id = '2dae597d14fc39d4b34fe747bf7afe2533f7f05afa2203c5f78b26c9cea0138e' 
  AND (
    token = 'qotPXJ9c2Ikr4MiSha6d+/R5MXopne9+HznMNyElvtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031