UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nQD2VsGbDUeUROwtSFu6y+qBZz5iJ29+1NUEB6guLaY=' 
WHERE 
  key_id = '0e9213f0341b4924ec60c791fd9355eb570a94602abbf96d98931a5afd00f170' 
  AND (
    token = 'nQD2VsGbDUeUROwtSFu6y+qBZz5iJ29+1NUEB6guLaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056