UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T+WXTTLC4ao2RJjVQI+l9wbAUzsjwrjJXndZlEuyMg4=' 
WHERE 
  key_id = 'dea6e464f1f1b1999c516cca307437117fe81e6a778c1703dbfd3e7fa1eabac9' 
  AND (
    token = 'T+WXTTLC4ao2RJjVQI+l9wbAUzsjwrjJXndZlEuyMg4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034