UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I+VlQT5ycTkWn2KXvdOJvtHhu33abwxzQ0kZarFQYek=' 
WHERE 
  key_id = 'd1d54f3b177f3d8948d778589c06d6b7542e515fc1185127b24fcce0525cd748' 
  AND (
    token = 'I+VlQT5ycTkWn2KXvdOJvtHhu33abwxzQ0kZarFQYek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060