UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jvi5nHQbw0kSfsWsDnZHJ/OfkIyQ7kyqGSQx2ZCWX70=' 
WHERE 
  key_id = '8129b56a2c4e1417b56a890e360ef4d2f04842d9571188d2614d775d15a37095' 
  AND (
    token = 'Jvi5nHQbw0kSfsWsDnZHJ/OfkIyQ7kyqGSQx2ZCWX70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037