UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kJutsnVzKTC+aeQS9iOOBu2Xilw0RPPPtShmVnUyvkU=' 
WHERE 
  key_id = 'e275fad636aeef6664c1cc3807a708c44055c25fdf3d817e5d9438bb67bd701a' 
  AND (
    token = 'kJutsnVzKTC+aeQS9iOOBu2Xilw0RPPPtShmVnUyvkU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031