UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cue5GfEKYflyebYVuk/19bRWd/oHCEQvYm+4Q0AnBFY=' 
WHERE 
  key_id = '5856f9c09bb5a1f5010de64ea9d0aaa927bad775733e7385696c6c849151e67c' 
  AND (
    token = 'Cue5GfEKYflyebYVuk/19bRWd/oHCEQvYm+4Q0AnBFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046