UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iz2NSF9nkSNbDiakt8L6+tzpFPegKkEUa1Dfgc4XAaE=' 
WHERE 
  key_id = '553edace0f60309a29bb4120aaf8c9b306178fea2d18fad879b1764d5b4879b9' 
  AND (
    token = 'iz2NSF9nkSNbDiakt8L6+tzpFPegKkEUa1Dfgc4XAaE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029